package com.kangtu.demoweixpay.controller;

import com.kangtu.demoweixpay.service.ITbUserService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

/**
 * @Description: TODO(这里用一句话描述这个类的作用)
 * @Author david
 * @Date 2021/4/19 18:26
 * @Copyright 康途慧智（北京）科技发展有限公司
 * @Version V1.0.0
 */

@RestController
@Slf4j
public class IndexController {

    @Autowired
    ITbUserService iTbUserService;

    @GetMapping(value = "/")
    String index() {
        return iTbUserService.get();
    }

    @PostMapping(value = "/add")
    String add(String userName, String userPass) throws Exception {
        return iTbUserService.add(userName, userPass);
    }

    @DeleteMapping(value = "/del")
    String del(Integer userId) throws Exception {
        return iTbUserService.del(userId);
    }

    @PutMapping(value = "/del")
    String set(String userName, String userPass) {
        return iTbUserService.set(userName, userPass);
    }
}
